﻿<%@ Page Language="C#" MasterPageFile="~/MasterPages/MasterPage.master" AutoEventWireup="true" CodeFile="EditPriceList.aspx.cs" Inherits="PriceList" Title="Ценова листа - редакция" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder" Runat="Server">
    РЕДАКТИРАНЕ НА ЦЕНОВАТА ЛИСТА!<br />
    <asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False"
        BackColor="White" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px"
        CellPadding="4" DataKeyNames="PriceID" DataSourceID="SqlDataSourcePrice">
        <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
        <Columns>
            <asp:CommandField CancelText="Прекъсни" DeleteText="Изтриване" EditText="Редакция"
                InsertText="Вмъкване" NewText="Нов" SelectText="Избери" ShowDeleteButton="True"
                ShowEditButton="True" UpdateText="Обнови" />
            <asp:BoundField DataField="NameBG" HeaderText="Наименование на БГ" SortExpression="NameBG" />
            <asp:BoundField DataField="PriceBGN" HeaderText="Цена в ЛВ" SortExpression="PriceBGN" />
            <asp:BoundField DataField="NameEN" HeaderText="Наименование на Англ." SortExpression="NameEN" />
            <asp:BoundField DataField="PriceEUR" HeaderText="Цена в ЕВРО" SortExpression="PriceEUR" />
        </Columns>
        <RowStyle BackColor="White" ForeColor="#330099" />
        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
        <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
    </asp:GridView>
    &nbsp;<table>
        <tr>
            <td style="width: 100px">
                Услуга - БГ</td>
            <td style="width: 100px">
                <asp:TextBox ID="txtServiceNameBG" runat="server" ValidationGroup="PriceListAdd"></asp:TextBox></td>
            <td style="width: 100px">
                <asp:RequiredFieldValidator ID="rfvServiceNameBG" runat="server" ControlToValidate="txtServiceNameBG"
                    Display="Dynamic" ErrorMessage='Полето "Услуга - БГ" е задължително!' ToolTip='Полето "Услуга - БГ" е задължително!'
                    ValidationGroup="PriceListAdd">*</asp:RequiredFieldValidator></td>
        </tr>
        <tr>
            <td style="width: 100px">
                Цена в лева</td>
            <td style="width: 100px">
                <asp:TextBox ID="txtPriceBGN" runat="server" ValidationGroup="PriceListAdd"></asp:TextBox></td>
            <td style="width: 100px">
                <asp:RequiredFieldValidator ID="rfvPriceBG" runat="server" ControlToValidate="txtPriceBGN"
                    Display="Dynamic" ErrorMessage='Полето "Цена в лева" е задължително!' ToolTip='Полето "Цена в лева" е задължително!'
                    ValidationGroup="PriceListAdd">*</asp:RequiredFieldValidator>
                <asp:CompareValidator ID="cvPriceBG" runat="server" ControlToValidate="txtPriceBGN"
                    Display="Dynamic" ErrorMessage="Моля въведете валидна цена!" Operator="DataTypeCheck"
                    ToolTip="Моля въведете валидна цена!" Type="Currency" ValidationGroup="PriceListAdd">*</asp:CompareValidator></td>
        </tr>
        <tr>
            <td style="width: 100px">
                Услуга - EN</td>
            <td style="width: 100px">
                <asp:TextBox ID="txtServiceNameEN" runat="server" ValidationGroup="PriceListAdd"></asp:TextBox></td>
            <td style="width: 100px">
                <asp:RequiredFieldValidator ID="rfvServiceNameEN" runat="server" ControlToValidate="txtServiceNameEN"
                    Display="Dynamic" ErrorMessage='Полето "Услуга - EN" е задължително!' ToolTip='Полето "Услуга - EN" е задължително!'
                    ValidationGroup="PriceListAdd">*</asp:RequiredFieldValidator></td>
        </tr>
        <tr>
            <td style="width: 100px">
                Цена в евро</td>
            <td style="width: 100px">
                <asp:TextBox ID="txtPriceEUR" runat="server" ValidationGroup="PriceListAdd"></asp:TextBox></td>
            <td style="width: 100px">
                <asp:RequiredFieldValidator ID="rfvPriceEN" runat="server" ControlToValidate="txtPriceEUR"
                    Display="Dynamic" ErrorMessage='Полето "Цена в евро" е задължително!' ToolTip='Полето "Цена в евро" е задължително!'
                    ValidationGroup="PriceListAdd">*</asp:RequiredFieldValidator>
                <asp:CompareValidator ID="cvPriceEN" runat="server" ControlToValidate="txtPriceEUR"
                    Display="Dynamic" ErrorMessage="Моля въведете валидна цена!" Operator="DataTypeCheck"
                    ToolTip="Моля въведете валидна цена!" Type="Currency" ValidationGroup="PriceListAdd">*</asp:CompareValidator></td>
        </tr>
        <tr>
            <td style="width: 100px">
                <asp:Button ID="btnInsert" runat="server" OnClick="BtnInsert_Click" Text="Добави" ValidationGroup="PriceListAdd" /></td>
            <td style="width: 100px">
            </td>
            <td style="width: 100px">
            </td>
        </tr>
    </table>
    <br />
    <br />
    <asp:SqlDataSource ID="SqlDataSourcePrice" runat="server"	 ConflictDetection ="OverwriteChanges"
        ConnectionString="<%$ ConnectionStrings:ClinicConnectionString %>" DeleteCommand="up_PriceListDelete"
        InsertCommand="up_PriceListInsert"
        OldValuesParameterFormatString="{0}" SelectCommand="up_PriceListSelect"
        UpdateCommand="up_PriceListUpdate" DeleteCommandType="StoredProcedure" InsertCommandType="StoredProcedure" SelectCommandType="StoredProcedure" UpdateCommandType="StoredProcedure">
        <DeleteParameters>
					<asp:Parameter Name="PriceID" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
					<asp:Parameter Name="PriceID" Type="Int32" />
            <asp:Parameter Name="NameBG" Type="String" />
            <asp:Parameter Name="PriceBGN" Type="Decimal" />
            <asp:Parameter Name="NameEN" Type="String" />
            <asp:Parameter Name="PriceEUR" Type="Decimal" />
        </UpdateParameters>
        <InsertParameters>
            <asp:ControlParameter ControlID="txtServiceNameBG" Name="NameBG" PropertyName="Text" Type="String" />
            <asp:ControlParameter ControlID="txtPriceBGN" Name="PriceBGN" PropertyName="Text" Type="Decimal" />
            <asp:ControlParameter ControlID="txtServiceNameEN" Name="NameEN" PropertyName="Text" Type="String" />
            <asp:ControlParameter ControlID="txtPriceEUR" Name="PriceEUR" PropertyName="Text" Type="Decimal" />
        </InsertParameters>
    </asp:SqlDataSource>
</asp:Content>

